/* GUI CONVERTED from rcpsmta.p (converter v1.75) Tue Apr 10 12:05:10 2001 */
/* rcpsmta.p - Release Management Customer Schedules                           */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.3.1.2 $                                                        */
/*V8:ConvertMode=Maintenance                                                  */

/* REVISION: 7.4    LAST MODIFIED: 05/22/96    BY: jpm *H0L5*                 */
/* REVISION: 8.6    LAST MODIFIED: 05/20/98    BY: *K1Q4* Alfred Tan          */
/* REVISION: 9.1    LAST MODIFIED: 08/12/00    BY: *N0KP* Mark Brown          */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* $Revision: 1.3.1.2 $    BY: Jean Miller         DATE: 03/22/01  ECO: *P008*    */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/* PLANNING SCHEDULE MAINT */

{mfdeclre.i}

define input parameter sch_recid as recid.
define input parameter sod_recid as recid.

find sch_mstr where recid(sch_mstr) = sch_recid exclusive-lock.
find sod_det  where recid(sod_det)  = sod_recid no-lock.

assign
   sch_fab_strt = sod_cum_date[1]
   sch_raw_strt = sod_cum_date[1].

if sod_fab_days > 0 then do:

   sch_fab_qty = sch_pcr_qty.

   for each schd_det
      where schd_type = sch_type
        and schd_nbr = sch_nbr
        and schd_line = sch_line
        and schd_rlse_id = sch_rlse_id
        and schd_date <= sch_pcs_date + sod_fab_days
   no-lock:
      assign
         sch_fab_qty = sch_fab_qty + schd_discr_qty
         sch_fab_end = schd_date.
   end.
end.

if sod_raw_days > 0 then do:

   sch_raw_qty = sch_pcr_qty.

   for each schd_det
      where schd_type = sch_type
        and schd_nbr = sch_nbr
        and schd_line = sch_line
        and schd_rlse_id = sch_rlse_id
        and schd_date <= sch_pcs_date + sod_raw_days
   no-lock:
      assign
         sch_raw_qty = sch_raw_qty + schd_discr_qty
         sch_raw_end = schd_date.
   end.

end.
